package com.scunewscreeper.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class StarNewsVO {
    @JsonProperty("newsId")
    private String newsId;
    @JsonProperty("time")
    private String starTime;
    @JsonProperty("source")
    private String newsSource;
    @JsonProperty("type")
    private String newsType;
    @JsonProperty("title")
    private String newsTitle;
    @JsonProperty("photo")
    private String photo;

    public StarNewsVO(String newsId, Date starTime, String newsSource, String newsType, String newsTitle, String photo) {
        SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String sdf1 = f.format(starTime);
        this.newsId = newsId;
        this.starTime = sdf1;
        this.newsSource = newsSource;
        this.newsType = newsType;
        this.newsTitle = newsTitle;
        this.photo = photo;
    }
}
